/* logs.css - 页面专属样式 */

body {
    background: #f5f5f5;
}

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header h1 {
    font-size: 24px;
    margin-bottom: 8px;
}

.header .subtitle {
    opacity: 0.9;
    font-size: 14px;
}

.controls {
    background: white;
    padding: 20px;
    border-bottom: 1px solid #e1e5e9;
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
}

.search-box {
    flex: 1;
    min-width: 300px;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 10px 40px 10px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 14px;
}

.search-input:focus {
    outline: none;
    border-color: #667eea;
}

.search-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
}

.filter-select {
    padding: 10px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 14px;
    background: white;
}

.stats {
    background: white;
    padding: 16px 20px;
    border-bottom: 1px solid #e1e5e9;
    display: flex;
    gap: 24px;
    align-items: center;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.stat-number {
    font-weight: 600;
    color: #667eea;
}

.stat-label {
    color: #666;
    font-size: 14px;
}

.logs-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.log-item {
    background: white;
    border-radius: 8px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.log-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e1e5e9;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: background 0.2s ease;
}

.log-header:hover {
    background: #f8f9fa;
}

.method-badge, .status-badge, .modal-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.method-get, .modal-method-get { background: #d4edda; color: #155724; }
.method-post, .modal-method-post { background: #fff3cd; color: #856404; }
.method-put, .modal-method-put { background: #d1ecf1; color: #0c5460; }
.method-delete, .modal-method-delete { background: #f8d7da; color: #721c24; }
.method-patch, .modal-method-patch { background: #e2e3e5; color: #383d41; }

.log-url {
    flex: 1;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    color: #495057;
    word-break: break-all;
}

.log-time {
    font-size: 12px;
    color: #6c757d;
}

.status-2xx, .modal-status-2xx { background: #d4edda; color: #155724; }
.status-3xx, .modal-status-3xx { background: #d1ecf1; color: #0c5460; }
.status-4xx, .modal-status-4xx { background: #fff3cd; color: #856404; }
.status-5xx, .modal-status-5xx { background: #f8d7da; color: #721c24; }
.status-error, .modal-status-error { background: #f8d7da; color: #721c24; }

.log-details {
    padding: 20px;
    background: #f8f9fa;
    display: none;
}

.log-details.show {
    display: block;
}

.detail-section {
    margin-bottom: 20px;
}

.detail-title {
    font-weight: 600;
    margin-bottom: 8px;
    color: #495057;
}

.detail-content {
    background: white;
    padding: 12px;
    border-radius: 4px;
    border: 1px solid #e1e5e9;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 200px;
    overflow-y: auto;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.empty-state .icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #6c757d;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 弹框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 900px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from { 
        transform: translateY(-30px);
        opacity: 0;
    }
    to { 
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e1e5e9;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px 12px 0 0;
}

.modal-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s ease;
    line-height: 1;
    padding: 0 4px;
}

.modal-close:hover {
    opacity: 1;
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #e1e5e9;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    background: #f8f9fa;
    border-radius: 0 0 12px 12px;
}

.modal-section {
    margin-bottom: 24px;
    background: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
}

.modal-section-header {
    background: #667eea;
    color: white;
    padding: 12px 16px;
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-section-content {
    padding: 16px;
    background: white;
}

.modal-info-grid {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 8px 16px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

.modal-info-label {
    font-weight: 600;
    color: #495057;
    white-space: nowrap;
}

.modal-info-value {
    color: #212529;
    word-break: break-all;
}

.modal-code {
    background: #f1f3f4;
    border: 1px solid #e1e5e9;
    border-radius: 6px;
    padding: 12px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 200px;
    overflow-y: auto;
    line-height: 1.4;
}

@media (max-width: 768px) {
    .controls {
        flex-direction: column;
        align-items: stretch;
    }

    .search-box {
        min-width: auto;
    }

    .stats {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .log-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .logs-container {
        padding: 16px;
    }
} 